package com.zoweunion.mechanic.util.task;

import com.zoweunion.mechanic.dao.shangji.ShangJiDao;
import com.zoweunion.mechanic.dao.shangji.ShangJiMapper;
import com.zoweunion.mechanic.service.app.OrderService;
import com.zoweunion.mechanic.service.shangji.ShangJiService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;

/**
 * @author zhangjun
 * @description 更新维修服务，租售，求职，招聘的浏览量修改，针对没有被更改的数据，
 */
@Component
public class BrowseAutoAddTask {
    protected Logger logger = LoggerFactory.getLogger(this.getClass());

    @Autowired
    ShangJiService shangJiService;

    @Autowired
    private OrderService orderService;

    @Scheduled(cron = "0 0 1 * * ? ")
    private void updateBrowse() {
        logger.info("定时任务：更新维修服务，租售，求职，招聘的浏览量");
        shangJiService.updateBrowseRandom();
    }
    /**
     * tdo 定时统计考核
     */
    @Scheduled(cron = "0 0 1 1/1 * ?")
    @GetMapping("/orderCheckPerformance")
    public void orderCheckPerformance() {
        orderService.orderCheckPerformance();
    }
}
